package com.bluesky.drcp.business.service;

import java.util.Date;

import com.bluesky.drcp.business.Log;
import com.bluesky.drcp.persistence.dao.LogDao;

public class LogService {
	private LogDao logDao;

	public void addLog(String userId, String computerName, String source,
			int type, String category, String action, String comment) {

		Log o = new Log();
		o.setUserId(userId);
		o.setDatetime(new Date());
		o.setComputerName(computerName);
		o.setSource(source);
		o.setType(type);
		o.setCategory(category);
		o.setAction(action);
		o.setComment(comment);

		logDao.insert(o);
	}

	public void insert(Log o) {
		logDao.insert(o);
	}

	public LogDao getLogDao() {
		return logDao;
	}

	public void setLogDao(LogDao logDao) {
		this.logDao = logDao;
	}
}
